//
//  SheetModifier.swift
//  DocScaner
//
//  Created by liyahao on 2025/8/13.
//

import SwiftUI

struct SheetModifier<V: View>: ViewModifier {
    @Binding var isPresented: Bool
    var sheetView: () -> V
    
    func body(content: Content) -> some View {
        ZStack {
            content
            sheetView()
        }
    }
}

extension View {
    func sheet<Content: View>(isPresented: Binding<Bool>, @ViewBuilder content: @escaping () -> Content) -> some View {
        self.modifier(SheetModifier(isPresented: isPresented, sheetView: content))
    }
}
